﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using ESPlus.Core;
using ESPlus.Application.Basic.Passive;
using ESBasic.ObjectManagement;
using ESPlus.Rapid;
using OMCS.Passive;

namespace Chat
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                IMultimediaManager multimediaManager = MultimediaManagerFactory.GetSingleton();
                RapidPassiveEngine rapidPassiveEngine = new RapidPassiveEngine();
                MainForm mainForm = new MainForm();
                LoginForm loginForm = new LoginForm(rapidPassiveEngine,multimediaManager, mainForm);
                if (loginForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                mainForm.Initialize(multimediaManager, rapidPassiveEngine);
                Application.Run(mainForm);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }
    }
}
